<%@page import="factory.DaoFactory"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0"/>
<script src="<%=request.getContextPath()%>/bootstrap-3.3.7-dist/js/jquery-3.3.1.min.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/bootstrap-3.3.7-dist/js/bootstrap.min.js" type="text/javascript"></script>
<link href="<%=request.getContextPath()%>/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet">
<title>上机考试管理系统</title>
<style type="text/css">
body{
	background:url('resource/background.jpg') repeat;
	background-size:400px 400px;
}
</style>
</head>
<body>
	<nav class="navbar nav-static-top navbar-default">
		<div class="container">
			<div class="navbar-header ">
				<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
					<span class="icon-bar"></span> 
					<span class="icon-bar"></span> 
					<span class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="login.jsp"> 上机考试管理系统 </a>
			</div>

			<div class="container">
				<div class="nav navbar-collapse collapse">
					<ul class="nav navbar-nav nav nav-tabs ">
						<li><a class="glyphicon glyphicon-user" href="#student"
							data-toggle="tab"> 学生</a></li>
						<li><a class=" glyphicon glyphicon-education" href="#teacher"
							data-toggle="tab"> 教师</a></li>
						<li><a class="glyphicon glyphicon-cog" href="#admin"
							data-toggle="tab"> 管理员</a></li>
					</ul>
				</div>
			</div>
		</div>
	</nav>
	<div class="tab-content">
		<div class="container tab-pane fade in active" id="student"
			role="tabpanel">
			<div class="row">
				<div class="col-sm-4"></div>
				<div class="col-sm-4 text-center"
					style="display: table-cell; background-color:#f8f8f8; border-radius: 5px; vertical_align: middle;">
					<form class="form-inline" action="servlet_login">
						<img src="<%=request.getContextPath()%>/resource/student.jpg" class="img-rounded" height=60
							style="float: left;">
						<h2>学生登陆</h2>
						<hr />
						<div>
							<input class="form-control" name="studentnumber" style="width: 100%" type="text"
								placeholder="请输入学号" />
						</div>
						<h6></h6>
						<div>
							<input class="form-control" name="studentname" style="width: 100%" type="text"
								placeholder="请输入姓名" />
						</div>
						<h6></h6>
						<div>
							<input class="btn btn-primary" style="width: 100%" type="submit"
								<%=(DaoFactory.getTeacherDaoInstance().loginsetsession().equals(null)||DaoFactory.getTeacherDaoInstance().loginsetsession().equals("") )? "disabled = 'disabled'":""%> value="登录" />
						</div>
						<h6></h6>
					</form>
				</div>
				<div class="col-sm-4"></div>
			</div>
		</div>
		<div class="container tab-pane" id="teacher">
			<div class="row">
				<div class="col-sm-4"></div>
				<div class="col-sm-4 text-center"
					style="display: table-cell; background-color:#f8f8f8; border-radius: 5px; vertical_align: middle;">
					<form class="form-inline" action="servlet_login_teacher">
						<img src="<%=request.getContextPath()%>/resource/teacher.jpg" class="img-rounded" height=60
							style="float: left;">
						<h2>教师登陆</h2>
						<hr />
						<div>
							<input name = "teachername" class="form-control"  style="width: 100%" type="text"
								placeholder="请输入用户名" />
						</div>
						<h6></h6>
						<div>
							<input name = "teacherpass" class="form-control" style="width: 100%" type="password"
								placeholder="请输入口令" />
						</div>
						<h6></h6>
						<div>
							<input class="btn btn-primary" style="width: 100%" type="submit"
								value="登录" />
						</div>
					</form>
				</div>
				<div class="col-sm-4"></div>
			</div>
		</div>
		<div class="container tab-pane" id="admin">
			<div class="row">
				<div class="col-sm-4"></div>
				<div class="col-sm-4 text-center"
					style="display: table-cell; background-color:#f8f8f8; border-radius: 5px; vertical_align: middle;">
					<form class="form-inline" action="adminlogin.action">
						<img src="<%=request.getContextPath()%>/resource/admin.png" class="img-rounded" height=60
							style="float: left;">
						<h2>管理员登陆</h2>
						<hr />
						<div>
							<input class="form-control" style="width: 100%" type="text" name="username" placeholder="请输入用户名" />
						</div>
						<h6></h6>
						<div>
							<input class="form-control" style="width: 100%" type="password" name="password" placeholder="请输入口令" />
						</div>
						<h6></h6>
						<div>
							<input class="btn btn-primary" style="width: 100%" type="submit"
								value="登录" />
						</div>
					</form>
				</div>
				<div class="col-sm-4"></div>
			</div>
		</div>
	</div>
	
			<s:set var="newVariable" scope="page" value="feedback"/>
			<%
				if(((String)pageContext.getAttribute("newVariable"))=="loginflase"){
					out.println("<script>alert('登陆错误，请核实用户名和密码是否输入正确,重新输入');javascript:history.go(-1);</script>");
				}
			%>
</body>
</html>
